package cn.wzg.netbase;

import static java.net.HttpURLConnection.HTTP_OK;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.view.View;
import android.widget.ImageView;

import androidx.activity.EdgeToEdge;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.ref.WeakReference;
import java.net.MalformedURLException;
import java.net.URL;

import javax.net.ssl.HttpsURLConnection;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_main);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });
    }
    public void toActivity(View view){
        Intent intent = null;
        int id = view.getId();
        if(id==R.id.button){
            intent=new Intent(this,GetImageActivity.class);
        }else if(id==R.id.button2){
            intent=new Intent(this,GetHtmlActivity.class);
        }else if(id==R.id.button3){
            intent=new Intent(this,LoginActivity.class);
        }else if(id==R.id.button6){
            intent=new Intent(this,CollectActivity.class);
        }else if(id==R.id.button7){
            intent=new Intent(this,HttpUtilCallActivity.class);
        }
        startActivity(intent);
    }
}